import { defineConfig } from 'vitepress'
// import { SearchPlugin } from '@pzy915/vitepress-plugin-search'
import { qqSvg } from './icon.js';
// import zh from './locales/zh.js';
// import jp from './locales/jp.js';
import sidebar from './sidebar.json';

// https://vitepress.dev/reference/site-config


export default defineConfig({
  // title: "Blog",
  // description: "Hzh100的私人博客",
  // vite: {
  //   plugins: [SearchPlugin({
  //     // 配置选项
  //     placeholder: '搜索文档',
  //     buttonLabel: '搜索',
  //     previewLength: 62,
  //     buttonPosition: 'right'
  //   })]
  // },
  locales: {
    root: {
      label: '中文',
      lang: 'zh',
      dir: 'src/zh',
      title: '博客',
      description: 'hzh100的私人博客'
    },
    en: {
      label: 'English',
      lang: 'en',
      dir: 'src/en',
      title: 'Blog',
      description: 'hzh100 blog'
    },
    // zh,
    // jp
  },
  head: [
    // ['meta', { name: 'author', content: 'Soybean' }],
    // [
    //   'meta',
    //   {
    //     name: 'keywords',
    //     content: 'soybean, soybean-admin, soybean-admin docs'
    //   }
    // ],
    ['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
    [
      'meta',
      {
        name: 'viewport',
        content: 'width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no'
      }
    ],
    ['link', { rel: 'icon', href: '/favicon.ico' }]
  ],
  assetsDir: 'public',
  srcDir: 'src',

  // https://vitepress.dev/reference/default-theme-config
  themeConfig: {
    // siteTitle: 'My Custom Title',
    logo: '/logo.svg',
    search: {
      provider: 'local'
    },
    // algolia: {
    //   appId: '98WN1RY04S',
    //   apiKey: '13e9f5767b774422a5880723d9c23265',
    //   indexName: 'soybean'
    // },
    socialLinks: [
      { icon: 'github', link: 'https://github.com/soybeanjs' },
      { icon: 'discord', link: 'https://discord.gg/mEFKh8xm9y' },
      {
        icon: {
          svg: qqSvg
        },
        link: 'https://qm.qq.com/cgi-bin/qm/qr?k=0TX9KUKJ9JNCwJeAvaKfJMxXp4Sd1nmt&jump_from=webapi&authKey=sc7Zwz/R98OxcLT9R/dlDftvl/vi4aKcD2rJmNR8mpbbjdDSegJDud2Q2DwW5HD+'
      }
    ],
    
    nav: [
      { text: '首页', link: '/test2', activeMatch: '/test2/' },
      // {
      //   text: 'Merchandise',
      //   link: 'https://www.thegithubshop.com/',
      //   // target: '_self',
      //   // rel: 'sponsored'
      // },
      { text: '模版', link: '/test/aaa', activeMatch: '/test/'  }
    ],

    sidebar,
    // sidebar:{
    // '/test/': [
    //     {
    //       text: 'Test',
    //       items: [
    //         { text: 'Test1', link: '/test/' },
    //         { text: 'Test2', link: '/test/test2' },
    //         { text: 'Test3', link: '/test/test3' },
    //         { text: 'Test4', link: '/test/test4' }
    //       ]
    //     },
    //     {
    //       text: 'Markdown 语法指南',
    //       items: [
    //         { text: '常用语法', link: '/md/' },
    //       ]
    //     }
    //   ]
    // },

    // editLink: {
    //   pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path',
    //   text: '在 GitHub 上编辑此页'
    // },
    docFooter: {
      prev: '上一页',
      next: '下一页'
    },
    footer: {
      message: 'Publish under the MIT license',
      copyright: 'Copyright © 2021 Soybean'
    },
  }
})
